Skip to content

Jj/klaijan/csv#200

Closed
Coniferish wants to merge 17 commits intomainfrom
jj/klaijan/csv
Closed

Jj/klaijan/csv#200
Coniferish wants to merge 17 commits intomainfrom
jj/klaijan/csv

Conversation

@Coniferish
Copy link
Contributor

@Coniferish Coniferish commented Oct 25, 2024

Return text/csv when output_format=OutputFormat.TEXT_CSV

responses:
"200":
application/json: [{"type": "Title", "element_id": "6aa0ff22f91bbe7e26e8e25ca8052acd", "text": "LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis", "metadata": {"languages": ["eng"], "page_number": 1, "filename": "layout-parser-paper.pdf", "filetype": "application/pdf"}}]
text/csv: "<value>"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Figure out how to get the example from the openapi spec in here

| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `csv_elements` | *Optional[str]* | :heavy_minus_sign: | Successful Response |
| `elements` | List[Dict[str, *Any*]] | :heavy_minus_sign: | Successful Response | No newline at end of file
Copy link
Contributor Author

@Coniferish Coniferish Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: elements isn't displayed as optional, but response.elements is None when csv_elements is returned.

r"""Successful Response"""
elements: NotRequired[List[Dict[str, Any]]]
r"""Successful Response"""

Copy link
Contributor Author

@Coniferish Coniferish Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NTS: elements is listed as NotRequired/Optional

@Coniferish Coniferish requested a review from Klaijan November 19, 2024 02:39
@awalker4 awalker4 closed this Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants